How to Set Up Hetzner Load Balancer Addon – Step‑by‑Step Guide
How to Set Up Hetzner Load Balancer Addon: A Beginner’s Guide
Managing traffic spikes and ensuring high availability can be challenging, especially when you’re running multiple services on Hetzner Cloud. The Hetzner Load Balancer Addon simplifies this by distributing requests across your servers, providing health checks, SSL termination, and auto‑scaling—all with a few clicks.
Why Use Hetzner Load Balancer Addon?
- Improved reliability: Automatic failover redirects traffic when a node goes down.
- Scalable performance: Add or remove backend servers without downtime.
- Built‑in security: Free SSL certificates and DDoS‑protected entry points.
- Cost‑effective: Pay only for the load balancer and the backend servers you use.
Step‑by‑Step Setup
1. Create a Load Balancer Instance
- Log in to the Hetzner Cloud Console.
- Navigate to Load Balancers → Create Load Balancer.
- Choose a region close to your users, select the desired plan, and give it a meaningful name.
2. Add Backend Servers
Backends are the servers that will receive traffic. You can attach existing Cloud Servers or create new ones directly from the load balancer UI.
- Select Add Backend and choose the target servers.
- Define a target port (e.g., 80 for HTTP, 443 for HTTPS).
- Optionally enable sticky sessions if your application requires session persistence.
3. Configure Health Checks
Health checks ensure that only healthy backends receive traffic.
- Protocol: HTTP, HTTPS, or TCP.
- Path:
/health(or any endpoint that returns 200 OK). - Interval: 10–30 seconds is typical.
- Timeout: 5 seconds.
4. Set Up SSL Termination (Optional but Recommended)
Secure your traffic at the edge by terminating SSL on the load balancer.
- Go to the SSL tab and click Add Certificate.
- Upload a trusted certificate/key pair or use Hetzner’s free Let’s Encrypt integration.
- Enable HTTPS Listener on port 443 and map it to your backend port (usually 80).
5. Define Listeners and Routing
A listener defines how incoming traffic is processed.
- Port: 80 (HTTP) or 443 (HTTPS).
- Protocol: HTTP or HTTPS.
- Forwarding Rule: Choose the backend pool created earlier.
6. Test the Configuration
After saving, access the load balancer’s public IP or DNS name. You should see your application responding. To verify health checks, inspect the Backend Overview – healthy nodes display a green check.
Best Practices
- Use multiple backends across zones: Improves fault tolerance.
- Enable session affinity only when necessary: Reduces cache effectiveness.
- Monitor metrics: Hetzner provides traffic, request count, and latency graphs – set up alerts for anomalies.
- Automate scaling: Combine the Load Balancer Addon with Hetzner’s Server Autoscaling API for dynamic capacity.
FAQ
Can I use Hetzner Load Balancer with Kubernetes?
Yes. Deploy the Load Balancer Addon, then expose your Kubernetes services via the Load Balancer IP. For advanced setups, Hetzner also offers a native Load Balancer Controller for Ingress resources.
What is the cost model?
Pricing is a fixed monthly fee for the load balancer instance plus data transfer charges. Backends are billed separately as standard Cloud Servers.
Is there a limit to the number of backends?
Each load balancer supports up to 100 backend servers, which is sufficient for most small‑to‑medium deployments.
Do I need a separate firewall rule?
Hetzner automatically opens ports 80 and 443 for the load balancer. However, you should restrict backend server firewalls to only accept traffic from the load balancer’s private IP range.
Can I reuse an existing SSL certificate?
Absolutely – upload any PEM‑encoded certificate and private key. Hetzner will handle renewal if you use Let’s Encrypt.
Conclusion
Setting up the Hetzner Load Balancer Addon is straightforward, yet it provides powerful features that protect your services from downtime, improve performance, and simplify SSL management. Follow the steps above, adopt the best practices, and you’ll have a resilient, scalable front‑end for your applications.
Ready to boost your Hetzner deployment? Start by creating a load balancer today and experience seamless traffic distribution.
Call to Action
Need help with migration or custom routing rules? Contact our cloud specialists for a free consultation.
Comments are closed, but trackbacks and pingbacks are open.